package com.example.service.impl;

import com.example.entity.Users;
import com.example.mapper.UsersMapper;
import com.example.service.UsersService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wjl
 * @since 2024-09-04
 */
@Service
public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements UsersService {
@Resource
UsersMapper usersMapper;
    @Override
    public String addUser(String uname, String password) {
        Users users = new Users();
        users.setUname(uname);
        users.setPassword(password);
        int i = usersMapper.insert(users);
        if(i>0){
            return "添加成功!!!";
        }
        return "添加失败!!!";
    }
}
